package com.example.bmd_espol;


import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;

public class MainActivity extends Activity implements OnClickListener {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		View rutas= findViewById(R.id.rutas);
		rutas.setOnClickListener(this);
		
		View mapas= findViewById(R.id.mapas);
		mapas.setOnClickListener(this);
		 
		View directorio = findViewById(R.id.directorio);
		directorio.setOnClickListener(this);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	@Override
	public void onClick(View vista) {
		// TODO Auto-generated method stub
		if(vista.getId()==findViewById(R.id.rutas).getId()){
			   Intent i = new Intent(this, BusesActivity.class);
			   startActivity(i);
			}
		   if(vista.getId()==findViewById(R.id.mapas).getId()){
			   Intent i = new Intent(this, MapaEspolActivity.class);
			   startActivity(i);
			}
		   if(vista.getId()==findViewById(R.id.directorio).getId()){
			   Intent i = new Intent(this, DirectorioActivity.class);
			   startActivity(i);
		   }
		
	}

}
